-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes spurious error messages in tests #1400
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding this!!
Just curious, were the tests passing in CI because GITHUB_SHA
, GITHUB_REF
, and GITHUB_EVENT_PATH
were set by default in CI, just not locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I checked this out locally and src/analyze-action-input.test.ts
is still failing. Thankfully we can just apply the same fix to get that passing. Once we've done that all the tests succeed locally.
The tests are still "passing" locally (ie- the test process doesn't fail and all 333 tests are marked as passing). It's just that there is a subprocess command that gets invoked and fails. The error is swallowed by the action (I think that's the behaviour we want). And most likely, we're not seeing the same messages on CI since all of the associated env vars are in place and the workflow file is where we expect it to be. |
Right...forgot about the second one. Let me get that in, too. |
Previously, `isAnalyzingDefaultBranch` was failing because there are some missing env vars: `GITHUB_SHA`, `GITHUB_REF`, and `GITHUB_EVENT_PATH`. Also, `checkout_path` is missing as an input. Rather than trying to set them to mock values, which would require setting the paths to existing paths in the file system, I chose to stub the entire function. I think this is fine since the point of the test is to check the ram and threads values, not testing the `isAnalyzingDefaultBranch` function.
e7f1de4
to
1384ce4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I pulled down the branch and ran to confirm this time as well 👍
Previously,
isAnalyzingDefaultBranch
was failing because there are some missing env vars:GITHUB_SHA
,GITHUB_REF
, andGITHUB_EVENT_PATH
. Also,checkout_path
is missing as an input.Rather than trying to set them to mock values, which would require setting the paths to existing paths in the file system, I chose to stub the entire function. I think this is fine since the point of the test is to check the ram and threads values, not testing the
isAnalyzingDefaultBranch
function.Merge / deployment checklist